package b4.controller
{
	import b4.model.*;
	import b4.model.vo.DataVO;
	import b4.view.*;
	import b4.view.component.load.LoadScene;
	
	import org.puremvc.as3.interfaces.ICommand;
	import org.puremvc.as3.interfaces.INotification;
	import org.puremvc.as3.patterns.command.SimpleCommand;
	import org.smartbird.SmartBirdClient;

	public class StartupCommand extends SimpleCommand implements ICommand
	{
		override public function execute(notification:INotification):void
		{
			var smartBirdClient:SmartBirdClient = new SmartBirdClient();
			var dataVO:DataVO = new DataVO();
			facade.registerProxy(new SmartBirdExtension(smartBirdClient, dataVO));
			facade.registerProxy(new TownProxy(smartBirdClient, dataVO));
			facade.registerMediator(new ApplicationMediator(notification.getBody()));
			var mainResourceLoader:ResourceLoader = new ResourceLoader("MainResource", ResourceLoader.TYPE_MAIN);
			mainResourceLoader.loadResources(["main_resource.swf", "config.xml"]);
			facade.registerProxy(mainResourceLoader);
			facade.registerMediator(new LoadSceneMediator("MainResource", new LoadScene()));
		}
	}
}